<?php

class User_Plugin_Menu
{
	function profileTimeline($item)
	{
		$resource = Nuo::getVar('mainResource');
		$item['url'] = $resource -> getUrl();
		return $item;
	}

	function profileAbout($item)
	{
		$resource = Nuo::getVar('mainResource');
		$item['url'] = $resource -> getUrl('about');
		return $item;
	}

	function profileFriend($item)
	{
		$resource = Nuo::getVar('mainResource');
		$item['url'] = $resource -> getUrl('friend');
		return $item;
	}

	function profileMore($item, $level, $render)
	{
		$item['type'] = 'html';
		$html = <<<HTML
<div class="uiToggleWrapper">
	<a class="itemAnchor" href="#" aria-click="toggle" class="uiSelectorButton">
		<i class="uiIcon"></i>
		<span class="">:label</span>
		<i class="uiIcon uiIconDropDown">&nbsp;</i>
	</a>
	<div class="uiToggleFlyout" id="ui-IqGB7I">
		<div class="uiSubMenu uiSelectorMenu">
			:submenu
		</div>
	</div>
</div>
HTML;
		$item['html'] = strtr($html, array(
			':label' => Intl::__($item['label']),
			':submenu' => $render -> render($item['items'], $level + 1,array("class"=>"uiMenuInner"))
		));
		unset($item['items']);
		
		return $item;
	}

}
